import React from 'react';
import { convertCurrency } from '@/utils/utils'
import { Table, Card } from 'antd';

class ViewPage extends React.Component<any, any> {
    render() {
        const { data } = this.props
        const dtls = data.items;
        const columns = [
            {
                title: '物料编码',
                dataIndex: 'partNum',
            },
            {
                title: '描述',
                dataIndex: 'partDescription',
            },
            {
                title: '版本号',
                dataIndex: 'revisionNum',
            },
            {
                title: '数量',
                dataIndex: 'quantity',
            },
            {
                title: '单位',
                dataIndex: 'ium',
            },
            {
                title: '单价',
                dataIndex: 'unitCost',
            },
            {
                title: '工费',
                dataIndex: 'lbrCost',
            },
            {
                title: '杂项费用',
                dataIndex: 'miscCost',
            },
            {
                title: '总成本',
                dataIndex: 'totalCost',
            },
        ];
        return (
            <Card bordered={false} key="C1">
                <h1 style={{ textAlign: 'center' }} key="1">销售报价单</h1>
                <Table
                    key="2"
                    rowKey="id"
                    columns={columns}
                    dataSource={dtls}
                    pagination={false}
                    bordered
                    footer={() => <span>税额：￥{data.totalTax} 未税金额：￥{data.totalCost} 含税总金额：{convertCurrency(data.totalTaxCost)} (￥{data.totalTaxCost})</span>} />

            </Card>
        )
    }
}
export default ViewPage;